{
const struct tm *tm = &s->current_tm;
+ if (s->time_offset_seconds != s->pt.vcpu->domain->time_offset_seconds) {
+ s->current_tm = gmtime(get_localtime(s->pt.vcpu->domain));
+ s->time_offset_seconds = s->pt.vcpu->domain->time_offset_seconds;
+ }
+
s->hw.cmos_data[RTC_SECONDS] = to_bcd(s, tm->tm_sec);
s->hw.cmos_data[RTC_MINUTES] = to_bcd(s, tm->tm_min);
if ( s->hw.cmos_data[RTC_REG_B] & RTC_24H )
}
/* update 'tm' to the next second */
-static void rtc_next_second(struct tm *tm)
+static void rtc_next_second(RTCState *s)
{
+ struct tm *tm = &s->current_tm;
int days_in_month;
+ if (s->time_offset_seconds != s->pt.vcpu->domain->time_offset_seconds) {
+ s->current_tm = gmtime(get_localtime(s->pt.vcpu->domain));
+ s->time_offset_seconds = s->pt.vcpu->domain->time_offset_seconds;
+ }
+
tm->tm_sec++;
if ((unsigned)tm->tm_sec >= 60) {
tm->tm_sec = 0;
}
else
{
- rtc_next_second(&s->current_tm);
+ rtc_next_second(s);
if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
struct timer second_timer;
struct timer second_timer2;
struct periodic_time pt;
+ int32_t time_offset_seconds;
} RTCState;
#define FREQUENCE_PMTIMER 3579545 /* Timer should run at 3.579545 MHz */